package com.labofjet.message;

import java.text.MessageFormat;
import java.util.Locale;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.AbstractMessageSource;
import org.springframework.stereotype.Component;

@Component
public class CacheableDBMessageSource extends AbstractMessageSource {

    @Autowired
    CacheableDBMessageService service;

    @Override
    protected MessageFormat resolveCode(String code, Locale locale) {
        return service.getMessage(code);
    }

}
